import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { PrismaService } from './prisma/prisma.service';
import { initSwagger } from './common';
import config from './config'

async function bootstrap() {
  const app = await NestFactory.create(AppModule)
  app.get(PrismaService).enableShutdownHooks(app)
  // openapi
  initSwagger(app)
  await app.listen(config.server.port)
}
bootstrap()
